package org.autumn.pool;

import java.util.Arrays;
import java.util.Timer;
import java.util.concurrent.*;

public class FutureTaskTest {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService service = Executors.newFixedThreadPool(2);

        Future<String> res = service.submit(() -> {
            TimeUnit.SECONDS.sleep(1);
            return "ok";
        });

        System.out.println(res.get());

    }
}
